import {
	sslwxbdApi
} from '@/api/assemb.js';

function audioTypeJudgment(url) {
	return new Promise((resolve, reject) => {
		let type = ['kwm', 'wma', 'mgg0'];
		let houzhui = url.substring(url.lastIndexOf('.') + 1);
		let judge = type.indexOf(houzhui);
		let typeUrl = ''
		if (judge != -1) {
			let param = {
				mp3url: url,
				audioType: 'mp3',
				workType: '3',
			}
			sslwxbdApi(param, 1005, 'smallTools').then(result => {
				typeUrl = result.mp3Url
				resolve(typeUrl)
			});
		} else {
			resolve(typeUrl)
		}
	})
}
export {
	audioTypeJudgment
}
